
package todolist.logic.task;

import java.util.Comparator;
import todolist.entity.TaskEntity;

/**
 * Compares two Tasks by TaskID, lower value first.
 * @author Eric
 * @author Ivan
 */
public class TaskIDAscending implements Comparator<TaskEntity> {

	/**
	 * Returns -ve on Task 1 having lower ID value, 0 on same, and +ve on higher.
	 * @throws IllegalArgumentException
	 */
	@Override
	public int compare(TaskEntity pentTask1, TaskEntity pentTask2) {
		if (pentTask1 == null || pentTask2 == null)
			throw new IllegalArgumentException("Comparator requires 2 non-null tasks.");
		return pentTask1.compareTo(pentTask2);
	}
	
	/**
	 * Comparators of this class is never equal to any other Comparator.
	 */
	@Override
	public boolean equals(Object pobjData) {
		return false;
	}
	
}
